import XSelect from "@/demos/XSelect";
import type { XSelectProps } from '@/demos/XSelect'
import React from "react";

const dataGridComboBoxEditor: React.FC<XSelectProps> = ({
    columns,
    dataSource,
    valueField,
    displayField,
    defaultText = "",
    onCommit
}) => {
    const editorRef = React.useRef<any>(null);
    React.useEffect(() => {
        if (editorRef.current) {
            editorRef.current.focus();
        }
    }, [editorRef]);
    return (
        <XSelect columns={columns}
            ref={editorRef}
            dataSource={dataSource}
            valueField={valueField}
            displayField={displayField}
            defaultText={defaultText}
            onCommit={onCommit}
        />
    )
}

export default dataGridComboBoxEditor